﻿#region Using Directives

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Xml.Linq;

    using Csla;

    using MarketPulse.BusinessLogic.Core;

#endregion

namespace MarketPulse.BusinessLogic.Private
{
    /// <summary>
    /// This class represents a collection of AssignmentEvents that are experienced by an Assignment during it's lifetime.
    /// </summary>
    [Serializable]
    [Csla.Server.ObjectFactory("MarketPulse.DataAccess.Factory.AssignmentFactory, MarketPulse.DataAccess.Factory", "FetchAssignmentEventList")]
    public class AssignmentEventList : MarketPulseListBase<AssignmentEventList, AssignmentEvent>
    {

        #region Constructors

            /// <summary>
            /// Default constructor is private in order to (try to) enforce construction
            /// only via the static factory methods provided.
            /// </summary>
            private AssignmentEventList()
            {
            }

        #endregion

        #region Methods

            #region Factory Methods

                /// <summary>
                /// Method used to create a new collection of AssignmentEventList objects via the DataPortal client proxy
                /// </summary>
                /// <returns>The newly created collection of AssignmentEvents</returns>
                internal static AssignmentEventList New()
                {
                    return DataPortal.CreateChild<AssignmentEventList>();
                }

                /// <summary>
                /// Method used to get a list of AssignmentEvents that are associated with a specific Assignment
                /// </summary>
                /// <param name="assignmentGuid">The Guid of the Assignment to retrieve the AssignmentEvent list for</param>
                /// <returns>The populated Assignment Event List collection</returns>
                internal static AssignmentEventList GetByAssignmentGuid(Guid assignmentGuid)
                {
                    return DataPortal.Fetch<AssignmentEventList>(new SingleCriteria<Guid>(assignmentGuid));
                }

            #endregion

        #endregion

    }
}
